package se.wangs.decorator.interfacetype.decorators;

import se.wangs.decorator.interfacetype.Beverage;
import se.wangs.decorator.interfacetype.CondimentDecorator;

/**
 * -- coding: UTF-8 -- *
 *
 * @author wangs
 * @date 2023/12/11 16:04
 * @description 加Mocha
 */
public class Mocha extends CondimentDecorator {
    /**
     * 这里需要向装饰器注入当前“原料”对象，用于给它添加调料
     * @param beverage 加入调料前的饮料
     */
    public Mocha(Beverage beverage) {
        super(beverage);
    }

    @Override
    public String getName() {
        return beverage.getName() + ", Mocha";
    }

    @Override
    public double cost() {
        return beverage.cost() + 0.20;
    }
}
